@import '~@styles/common.less';

.player {
  position: fixed;
  bottom: 64px;
  right: 26px;
  width: 278px;
  z-index: 99;
  transition: all 0.3s ease-in-out;

  .musicInfo {
    position: absolute;
    left: 9px;
    bottom: 70px;
    width: 260px;
    height: 85px;
    background: @sky-blue;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    transition: all 0.3s ease-in-out;

    .nameInfo {
      width: 100%;
      padding: 5px 10px 0 10px;

      .musicName {
        height: 28px;
        overflow: hidden;
        text-align: right;
        background-color: #d1eaf5;

        .musicLrcList {
          height: auto;
          text-align: right;
          transition: all 0.3s ease-in-out;

          .musicLrcItem {
            height: 25px;
            line-height: 25px;
          }

          .currentLine {
            color: @menu-active;
          }
        }
      }

      .artistName {
        height: 20px;
        font-size: 14px;
        text-align: right;
      }

      .artistName {
        font-size: 12px;
        color: #656565;
      }
    }

    .time {
      display: flex;
      justify-content: space-between;
      position: absolute;
      bottom: 6px;
      right: 0;
      font-size: 12px;
      height: 20px;
      margin: 5px 0;
      width: calc(260px - 120px);
      padding: 0 10px;

      .currentTime {
        float: left;
      }
      .totalTime {
        float: right;
      }
      .currentTime,
      .totalTime {
        font-size: 12px;
        line-height: 28px;
        transition: 0.3s ease all;
      }
    }

    .progress {
      position: absolute;
      height: auto;
      border-radius: 5px;
      width: 136px;
      max-width: 136px;
      margin-left: 124px;
      bottom: 0;
      cursor: pointer;

      &:hover {
        .hoverBar {
          position: relative;
          display: block;
          height: 5px;
          border-radius: 5px;
          background-color: @menu-active;
          // background-color: @menu-deep;
          z-index: 9;

          &::after {
            content: '';
            position: absolute;
            top: 50%;
            right: 0;
            transform: translateY(-50%);
            width: 10px;
            height: 10px;
            border-radius: 10px;
            background-color: @menu-active;
          }
        }

        .insTime {
          display: block;
          position: absolute;
          top: -26px;
          background-color: #e8f5ff;
          font-size: 12px;
          white-space: pre;
          padding: 0 6px;
          border-radius: 5px;
          z-index: 9;
        }
      }

      .timeSlider {
        margin: 0 0 -5px 0;
        visibility: visible;
      }

      .seekBar {
        height: 5px;
        border-radius: 5px;
        background-color: @menu-active;
        z-index: 9;
        width: 0;
      }

      .hoverBar {
        width: 0;
        display: none;
      }

      .insTime {
        left: 0;
        display: none;
      }

      :global {
        .ant-slider:hover .ant-slider-rail {
          background-color: @light-green;
        }
      }
    }
  }

  .hideMusicInfo {
    bottom: 5px;
    height: 60px;
    transition: all 0.3s ease-in-out;

    .progress {
      .timeSlider {
        visibility: hidden;
      }
    }
  }

  .musicList {
    position: absolute;
    width: 260px;
    bottom: 70px;
    left: 9px;
    background-color: @sky-blue;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    transition: all 0.3s ease-in-out;

    .musicItem {
      position: relative;
      height: 35px;
      line-height: 35px;
      padding: 0 12px;
      border-bottom: 1px solid @background;
      text-align: right;
      cursor: pointer;

      &:hover {
        background-color: @menu-active;
        color: @fff;
        z-index: 99;
      }

      &:first-child {
        border-top-left-radius: 5px;
        border-top-right-radius: 5px;
      }
    }
  }

  .lrcInfo {
    position: absolute;
    left: 9px;
    bottom: 5px;
    width: 260px;
    height: 60px;
    border-radius: 5px;
    overflow: hidden;
    background-color: @sky-blue;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 -1px 0 @menu-active inset;
    z-index: -1;

    .lrcHeader {
      height: 60px;
      text-align: center;
      box-shadow: 0 0 1px @menu-active;

      .musicTitle {
        height: 32px;
        line-height: 32px;
        font-weight: 600;
        font-size: 16px;
        color: @menu-active;
      }

      .authorName {
        font-size: 13px;
        text-align: right;
        padding-right: 10px;
        color: @menu-active;
      }
    }

    .musicLrcWrap {
      width: 260px;
      height: 400px;
      border-radius: 5px;
      overflow: hidden;

      .musicLrcList {
        height: auto;
        text-align: center;
        transition: all 0.3s ease-in-out;

        .musicLrcItem {
          height: 25px;
          line-height: 25px;
          .ellipsis();
        }

        .currentLine {
          color: @menu-active;
        }
      }
    }
  }

  .showLrcInfo {
    bottom: 155px;
    height: 467px;
    transition: all 0.3s ease-in-out;
  }

  .hideMusicList {
    bottom: 5px;
    height: 60px;
    transition: all 0.3s ease-in-out;

    .musicItem {
      display: none;
    }
  }

  .playerContent {
    position: relative;
    width: 278px;
    height: 70px;

    background: @fff;
    border-radius: 10px;
    box-shadow: 0 10px 60px #c9c9c9;

    .musicMenu {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);

      .controlBtn {
        color: @menu-active;
        cursor: pointer;
      }
    }

    .musicImgs {
      position: absolute;
      top: -46px;
      width: 90px;
      height: 90px;
      margin-left: 33px;
      transform: rotateZ(0);
      transition: 0.3s ease all;
      box-shadow: 0 0 0 10px @fff, 0px -10px 10px 0px #c9c9c9;
      border-radius: 110px;
      overflow: hidden;

      &:hover {
        .lrcMenu {
          display: flex;
        }
      }

      .lrcMenu {
        display: none;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 2;
        background-color: rgba(0, 0, 0, 0.25);
        cursor: pointer;

        .lrcBtn {
          color: @menu-active;
        }
      }

      .img {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;

        .cover {
          width: 90px;
          height: 90px;
          min-width: 100px;
          min-height: 100px;
        }

        .coverRotate {
          animation: rotate 3s linear 0s infinite forwards;
        }
      }

      &:before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 15px;
        height: 15px;
        background-color: @fff;
        border-radius: 50%;
        box-shadow: inset 0 0 0 2px @menu-hover;
        z-index: 2;
      }
    }

    .bufferBox {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 100%;
      height: 20px;
      line-height: 20px;
      font-size: 12px;
      text-align: center;
      background-color: rgba(225, 225, 225, 0.85);
      z-index: 9;
    }

    .playerControls {
      display: flex;
      justify-content: center;
      align-items: center;
      position: absolute;
      top: 50%;
      left: 125px;
      transform: translateY(-50%);

      .btn {
        position: relative;
        height: 32px;
        line-height: 32px;
        padding: 0 5px;
        cursor: pointer;
      }

      .mute {
        position: relative;
        z-index: -1;

        &::after {
          content: '';
          position: absolute;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%) rotate(-45deg);
          height: 20px;
          width: 1px;
          background-color: @menu-active;
        }
      }

      .play {
        font-size: 24px;
        color: @menu-active;
      }

      .prev,
      .next {
        font-size: 20px;
        color: @menu-active;
      }

      .controlBtn {
        color: @menu-active;
      }
    }
  }
}

.toggle {
  right: -305px;
  transition: all 0.3s ease-in-out;
}

.dropdown {
  :global {
    .ant-dropdown-menu-item {
      padding: 10px 0 5px 0;

      &:hover {
        background-color: transparent;
      }
    }
  }
}

.volume {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 120px;

  .sliderWrap {
    display: inline-block;
    height: 100%;
  }

  .volumeProgress {
    height: 120px;
    width: 6px;
    border-radius: 6px;
    background-color: @menu-active;
  }

  .count {
    margin-top: 15px;
    min-width: 40px;
    text-align: center;
  }
}

:global {
  .ant-tooltip {
    display: none !important;
  }
}

@-webkit-keyframes rotateAlbumArt {
  0% {
    -webkit-transform: rotateZ(0);
    transform: rotateZ(0);
  }
  100% {
    -webkit-transform: rotateZ(360deg);
    transform: rotateZ(360deg);
  }
}

@keyframes rotateAlbumArt {
  0% {
    -webkit-transform: rotateZ(0);
    transform: rotateZ(0);
  }
  100% {
    -webkit-transform: rotateZ(360deg);
    transform: rotateZ(360deg);
  }
}

@keyframes rotate {
  0% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  50% {
    -webkit-transform: rotate(180deg);
    transform: rotate(180deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

@media screen and (max-width: 960px) {
  .player {
    left: 20px;

    .lrcInfo {
      height: 60px;
    }

    .showLrcInfo {
      bottom: 155px;
      height: calc(100vh - 275px);
      transition: all 0.3s ease-in-out;
    }
  }

  .toggle {
    right: initial;
    left: -305px;
    transition: all 0.3s ease-in-out;
  }
}
